<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>走马灯案例</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    li {
      list-style: none;
    }
    img {
      display: block;
      width: 200px;
    }
    .box {
      width: 600px;
      height: 112px;
      border: 5px solid #000;
      margin: 100px auto;
      overflow: hidden;
    }
    .box ul {
      display: flex;
      animation: move 6s infinite linear;
    }
    /* 思路: 定义位移动画;ul使用动画;鼠标悬停暂停动画 */
    @keyframes move {
      from {
        transform: translate(0);
      }
      to {
        transform: translate(-1400px);
      }
    }
    .box:hover ul {
      animation-play-state: paused;
    }
  </style>
</head>
<body>
  <div class="box">
    <ul>
      <li><img src="./images/1.jpg" alt=""></li>
      <li><img src="./images/2.jpg" alt=""></li>
      <li><img src="./images/3.jpg" alt=""></li>
      <li><img src="./images/4.jpg" alt=""></li>
      <li><img src="./images/5.jpg" alt=""></li>
      <li><img src="./images/6.jpg" alt=""></li>
      <li><img src="./images/7.jpg" alt=""></li>

      <!-- 无缝动画, 替身: 填补显示区域的露白 -->
      <li><img src="./images/1.jpg" alt=""></li>
      <li><img src="./images/2.jpg" alt=""></li>
      <li><img src="./images/3.jpg" alt=""></li>
    </ul>
  </div>
</body>
</html>